< previous page page_426 next page >

Page 426
TABLE 15.7. THE PICTUREBOX CONTROLS AND PROPERTY SETTINGS.
ControlPropertyValue
PictureBoxNamepicDisplay
OLEDropModeManual
Borderstyle0-None
Height330
Width360
Top60
PictureBoxNamepicDelete
OLEDropModeManual
Borderstyle0-None
Height330
Width360
Top60
PictureBoxNamepicPrint
OLEDropModeManual
Borderstyle0-None
Height330
Width360
Top60

Choose the pictures you want to represent the three functions. In addition, you need to set the TreeView control's OLEDRAGMODE property to Automatic to enable the addition of code to start the drag process. After you have done this, the only step remaining is to add the code that will place the selected names record key into the DataObject when the drag process is started, and then when the data is dropped, the PictureBox that it was dropped on will retrieve the record key and perform the operation specified for that PictureBox (such as display, delete, or print). The code in Listing 15.5 performs the action for the display event.
LISTING 15.5 ADDRESSDRAG.TXTSETTING THE DRAG OPERATION FOR THE ADDRESS BOOK APPLICATION.

8694cbadb9b1ef7075903f6f95fc1db2.gif
 1: Private Sub tvTreeView_OLEStartDrag(Data As ComctlLib.DataObject,_
 2: AllowedEffects As Long)
 3:     Data.SetData tvTreeView.SelectedItem.Key
 4: End Sub

 
< previous page page_426 next page >

If you like this book, buy it!